package indi.zhifa.recipe.bailan.busy.handler;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import indi.zhifa.recipe.bailan.framework.common.util.SnowflakeIdWorker;
import org.springframework.data.domain.AuditorAware;
import org.springframework.stereotype.Component;

import java.util.Optional;

@Component
public class JPAAuditorAware implements AuditorAware<Long> {
    @Override
    public Optional<Long> getCurrentAuditor() {
        Long id = SnowflakeIdWorker.generateId();
        return Optional.of(id);
    }
}
